<template>
  <footer>
    <ul>
      <!-- vue-router(3) 声明式导航 -->
      <!-- router-link 使选中的元素赋予 router-link-exact-active 和 router-link-active 类名，而且还可通过 active-class="" 修改 router-link-active 成想要的类名名称 -->
      <!--      <li>-->
      <!--        <router-link to="/films">电影</router-link>-->
      <!--      </li>-->
      <!--      <li>-->
      <!--        <router-link to="/cinemas">影院</router-link>-->
      <!--      </li>-->
      <!--      <li>-->
      <!--        <router-link to="/center">我的</router-link>-->
      <!--      </li>-->

      <!-- vue-router(4) 声明式导航 -->
      <router-link to="/films" custom v-slot="{navigate,isActive}">
        <li @click="navigate" :class="isActive?'router-link-active':''">
          <i class="iconfont icon-dianying"></i>
          <span>电影</span>
        </li>
      </router-link>
      <router-link to="/cinemas" custom v-slot="{navigate,isActive}">
        <li @click="navigate" :class="isActive?'router-link-active':''">
          <i class="iconfont icon-yingyuan"></i>
          <span>影院</span>
        </li>
      </router-link>
      <router-link to="/inform" custom v-slot="{navigate,isActive}">
        <li @click="navigate" :class="isActive?'router-link-active':''">
          <i class="iconfont icon-yingpingmoban"></i>
          <span>资讯</span>
        </li>
      </router-link>
      <router-link to="/center" custom v-slot="{navigate,isActive}">
        <li @click="navigate" :class="isActive?'router-link-active':''">
          <i class="iconfont icon-wode"></i>
          <span>我的</span>
        </li>
      </router-link>
    </ul>
  </footer>
</template>

<style lang="scss" scoped>
footer{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 49px;
  background-color: #fff;
  border-top: 1px solid #ececec;
  z-index: 100;
  ul{
    display: flex;
    li{
      flex: 1;
      font-size: 12px;
      color: #898d91;
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      i{
        padding-top: 5px;
        font-size: 25px;
      }
      span{
        line-height: 14px;
      }
    }
  }
}
.router-link-active {
  color: #ff7737;
}
</style>
